<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="/lottery/js/validate.js"></script>
<link href="/lottery/css/common.css" type="text/css" rel="stylesheet" />
<title>添加奖品</title>
</head>

<body>
<div id="man_zone">
	<c:if test="${empty prize.prizeId}">
		<div class="operation_addtile">
			添加奖品
		</div>
	</c:if>
	<c:if test="${!empty prize.prizeId}">
		<div class="operation_addtile">
			修改奖品
		</div>
	</c:if>
<form action="<c:url value="/admin/prize.do?action=insertAndUpdate"/>" method="post"
	name="prizeForm" id="prizeForm" onSubmit="return checkPrizeForm()" >
	
<c:set var="typeArray" value="1 一等奖,2 二等奖,3 三等奖,4 四等奖,5 五等奖"/>
<c:set var="statusArray" value="${fn:split(typeArray, ',')}"/>

<input type="hidden" name="id" value="<c:out value="${prize.prizeId}"/>"/>
<table width="99%" border="0" align="center" cellpadding="3"
	cellspacing="1" class="table_style">
	<tr>
		<td width="18%" class="left_title_1">奖品名称</td>
		<td width="82%"><input type="text" name="prizeName"
			id="prizeName" value="<c:out value="${prize.prizeName}"/>" title="请输入奖品名称" size="50"/>
			<SPAN class="button_title"">
			<c:out value="${message}"/>
			</SPAN>
			</td>
	</tr>
	<tr>
		<td  class="left_title_2">所属活动</td>
		<td>
			<select name="phaseId" id="phaseId">
				<option value="">请选择活动</option>
				<c:forEach var="item" items="${phaseList}">
					<option value="${item.phaseId}" <c:if test="${item.phaseId==prize.phaseId}"> selected="selected"</c:if>>
						${item.phaseName}
					</option>
				</c:forEach>
			</select>
		</td>
	</tr>
	
	<tr>
		<td class="left_title_2">奖品等级</td>
		<td>
			<select name="prizeLevel" id="prizeLevel">
				<c:forEach var="statusArrayItem" items="${statusArray}">
					<c:set var="codeAndStatus" value="${fn:split(statusArrayItem, ' ')}" />
					<option value="${codeAndStatus[0]}"
					<c:if test="${codeAndStatus[0] == prize.prizeLevel}"> selected="selected"</c:if>>
					${codeAndStatus[1]}
					</option>
				</c:forEach>
			</select>		
		</td>
	</tr>
	
	<tr>
		<td  class="left_title_1">价值</td>
		<td>
		<input type="text" name="prizePrice" id="prizePrice" value="${prize.prizePrice}"/>
		</td>
	</tr>
	
	<tr bgcolor="#FFFFFF">
		<td>&nbsp;</td>
		<td>
		<input type="submit" value="提交" /> 
		
		</td>
	</tr>
</table>

</form>
</div>
</body>
</html>

